home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / doc / libmailtools-perl / demos / rplyto_demo < prev    next >
Encoding:
Text File  |  2008-11-04  |  415 b   |  25 lines

  1. #!/usr/bin/perl -w
  2. use Mail::Internet;
  3.  
  4. $mail = Mail::Internet->new([<>]);
  5. $rply = $mail->reply(Keep => [qw(Newsgroups)]);
  6.  
  7. $file = "/tmp/reply.$$";
  8.  
  9. open(REPLY,">$file") || die "Cannot open $file:$!\n";
  10.  
  11. $rply->print(\*REPLY);
  12.  
  13. close(REPLY);
  14.  
  15. $editor = $ENV{"EDITOR"} || die "\$EDITOR not defined\n";
  16.  
  17. warn "$editor :$!\n" if (system("$editor $file"));
  18.  
  19. # Cleanup
  20. unlink($file,$file . '%',$file . '~');
  21.  
  22. exit 0;
  23.  
  24.  
  25.